import 'package:flutter/material.dart';
import 'package:full_display/common/qxp_color.dart';
import 'package:full_display/common/qxp_style.dart';
import 'package:full_display/page/montage/montage_provider.dart';
import 'package:full_display/unit/screen/screen_utility.dart';
import 'package:full_display/unit/widgets/widget_button_list.dart';
import 'package:provider/provider.dart';

typedef OnPickImageCallback = void Function(
    double? maxWidth, double? maxHeight, int? quality);

class MAddMediaDialog extends Dialog {
  Function(int index, BuildContext context) tapAction;
  MAddMediaDialog({super.key, required this.tapAction});
  // var _montageProvider = MontageProvider();
  List mplayModel = [
    {'img': 'm_neiqie', 'text': '内切', "index": 0},
    {'img': 'm_waiqie', 'text': '外切', "index": 1},
    {'img': 'm_tongbu', 'text': '同步', "index": 2},
  ];
  @override
  Widget build(BuildContext context) {
    // _montageProvider = context.watch<MontageProvider>();
    return Material(
      type: MaterialType.transparency,
      child: Center(
        child: Container(
          width: 253.0.W,
          height: 200.0.W,
          decoration: const BoxDecoration(
            gradient: LinearGradient(
                //渐变位置
                begin: Alignment.topCenter, //右上
                end: Alignment.bottomCenter, //左下
                //渐变颜色[始点颜色, 结束颜色]
                colors: [ColorPlate.app_blue, ColorPlate.sub_blue]),
            borderRadius: BorderRadius.all(Radius.circular(8.0)),
          ),
          child: Container(
            child: Column(
              children: [
                Container(
                  height: 20.0.H,
                ),
                Text(
                  "选择视频播放方式",
                  style: StandardTextStyle.textWhite17Style,
                  textAlign: TextAlign.center,
                ),
                Container(
                  height: 20.0.H,
                ),
                ButtonListWidget(
                    btnList: mplayModel, tapAction: tapAction, isBg: true),
              ],
            ),
          ),
        ),
      ),
    );
  }
}
